import { stringify } from "qs";
import request from "@/utils/request";

export async function roleList(params) {
  return request(`/role/query`, {
    method: "POST",
    body: {
      ...params
    }
  });
}

export async function removeUser(params) {
  return request(`/role/del/${params.key}`, {
    method: "POST",
    body: {}
  });
}

export async function addRole(params) {
  return request("/role/add", {
    method: "POST",
    body: {
      ...params
    }
  });
}

export async function editUser(params) {
  return request("/role/edit", {
    method: "POST",
    body: {
      ...params,
      method: "update"
    }
  });
}

export async function rolePermission(params) {
  return request("/role/permission/list", {
    method: "POST",
    body: params
  });
}

export async function roleDetail(params) {
  return request(`/role/detail/${params.roleNo}`, {
    method: "POST",
    body:{}
  });
}


export async function roleBindPower(params) {
  return request(`/role/bind`, {
    method: "POST",
    body:params
  });
}

